<?php 
$search = array("\\\"", "\\'");
$replace = array("","'");
echo nl2br(str_replace($search, $replace, $view->contest['tos_text'])); ?>

<script type="text/javascript">
    contestapp.tosbox.tostitle = "<?php echo nl2br(str_replace("\\\"", "", $view->contest['tos_link_text'])); ?>";
</script>